home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com(Pete)
- Newsgroups: comp.lang.c++
- Subject: Re: Beginner: How to #include
- Date: 31 Jan 1996 17:35:40 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4eo99c$lnc@news1.usa.pipeline.com>
- NNTP-Posting-Host: pipe4.h1.usa.pipeline.com
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline USA v3.3.0
-
- On Jan 30, 1996 18:32:06 in article <Beginner: How to #include>,
- 'west@emt.e-technik.tu-muenchen.de (Robert Westendorp)' wrote:
-
- The "standard" way to suppress multiple definitions/declarations
- in a header file that may be included more than once is to wrap
- all the code therein inside a #ifdef - #endif block
-
- >Hi there,
- >
- >following problem with hierarchical including:
- >
- >my_data.h:
- >
- #if !defined(_MY_DATA_H_)
- #define _MY_DATA_H
-
- >#include "picture.h"
- >
- >class A
- >{
- >...
- >CPicture m_picture;
- >
- >...
- >}
-
- #endif // last line in your .h file to match the first #if !defined
-
- --
- Pete Grant
- Kalevi, Inc.
- Object Oriented Software Development
-